package demo;

import org.opengauss.jdbc.PgConnection;

import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 */
public class SimpleDemo {

    private static String url = "jdbc:opengauss://192.168.0.243:14100,192.168.0.243:14200,192.168.0" +
        ".243:14300/test?autoBalance=priority2&loggerLevel=OFF";

    private static String user = "test";

    private static String password = "huawei123.";

    public static void main(String[] args) throws SQLException {
        int n = 20;
        for (int i = 0; i < n; i++) {
            PgConnection pgConnection = DriverManager.getConnection(url, user, password).unwrap(PgConnection.class);
            System.out.println(pgConnection.getSocketAddress());
        }
    }
}
